const {
  name
} = require('./package');

const path = require("path");

const resolve = dir => {
  return path.join(__dirname, dir);
};

module.exports = {
  lintOnSave: false,
  devServer: {
    port: 10002,
    headers: {
      'Access-Control-Allow-Origin': '*',
    },
    hot: true
  },
  configureWebpack: {
    output: {
      // 把子应用打包成 umd 库格式
      library: `${name}-[name]`,
      // filename: `${microName}-[name].js`,
      libraryTarget: 'umd',
      jsonpFunction: `webpackJsonp_${name}`,
      // globalObject: 'this',
    },
  },
  publicPath: '/',
  chainWebpack: config => {
    config.performance.set("hints", false); //删除性能提示
    config.resolve.alias
      .set("@", resolve("src")) // key,value自行定义，比如.set('@@', resolve('src/components'))
      .set("_c", resolve("src/components"))
      .set('_vc', resolve('src/view/components'))
  },
}